package com.twu.biblioteca;

/**
 * Created with IntelliJ IDEA.
 * User: aulme
 * Date: 01/07/2013
 * Time: 12:20
 * To change this template use File | Settings | File Templates.
 */
public class Book {

    private final String name;
    private final boolean isReserved;

    public Book(String name, boolean isReserved) {
        this.name = name;
        this.isReserved = isReserved;
    }

    public String getName() {
        return name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Book book = (Book) o;

        if (!name.equals(book.name)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return name.hashCode();
    }

    public boolean getIsReserved() {
        return isReserved;
    }
}
